using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class Br_ReportFormsMap : EntityTypeConfiguration<Br_ReportForms>
    {
        public Br_ReportFormsMap()
        {
            // Primary Key
            this.HasKey(t => new { t.Code, t.Title, t.Report });

            // Properties
            this.Property(t => t.Code)
                .IsRequired()
                .HasMaxLength(10);

            this.Property(t => t.Title)
                .IsRequired()
                .HasMaxLength(18);

            this.Property(t => t.Report)
                .IsRequired()
                .HasMaxLength(20);

            // Table & Column Mappings
            this.ToTable("Br_ReportForms");
            this.Property(t => t.Code).HasColumnName("Code");
            this.Property(t => t.Title).HasColumnName("Title");
            this.Property(t => t.Report).HasColumnName("Report");
        }
    }
}
